<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <style>
            div {
                margin: 10% 20%;
            }

            button {
                margin-top: 20px;
                font-size: 50px;
                padding: 20px;
                border-radius: 10px;
                border: none;
            }
        </style>
    </head>
    <body>
        <div>
            <button onclick="demoGetTest()">Click Me "GET" Request!</button>

            <button onclick="demoPostTest()">Click Me "POST" Request!</button>
        </div>
    </body>
    <script src="./js/ajax-without-jquery.js"></script>
    <script>
        function demoGetTest() {
            ajaxRequest({
                url: "./get_interface.php",
                data: {a: 1, b: 2, c: 1222, type: "GET", "haha": "中文啊。。。"},
                type: "GET",
                success: function (res) {
                    console.log(res);
                }
            });
        }

        function demoPostTest() {
            ajaxRequest({
                url: "./post_interface.php",
                data: {a: 1, b: 2, c: 45, type: "POST", "haha": "中文啊。。。"},
                type: "POST",
                success: function (res) {
                    console.log(res);
                }
            });
        }
    </script>
</html>